<!DOCTYPE html>
<html>
<head>
<title>{$site_name}</title>
<meta name="keywords" content="{$site_seo_keywords}" />
<meta name="description" content="{$site_seo_description}">

<tc_include file="Public:head" />
</head>
<body class="body-white" id="top">
	<tc_include file="Public:nav" />

		<div class="container tc-main">
                <div class="row">
                    <div class="span3">
	                    <tc_include file="Public:usernav"/>
                    </div>
                    <div class="span9">
                           <div class="tabs">
                               <ul class="nav nav-tabs">
                                   <li class="active"><a href="#one" data-toggle="tab"><i class="fa fa-lock"></i>添加公众号</a></li>
                               </ul>
                               <div class="tab-content">
                                   <div class="tab-pane active" id="one">
                                   		<form class="form-horizontal J_ajaxForm" action="{:u('profile/addPubWec')}" method="post">
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-old_password">公众号名称</label>
                                   				<div class="controls">
                                   					<input type="text" id="input-old_password" placeholder="公众号名称" name="pwc_name">
                                   				</div>
                                   			</div>
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-old_password">公众号id</label>
                                   				<div class="controls">
                                   					<input type="text" id="input-old_password" placeholder="公众号id" name="pwc_id">
                                   				</div>
                                   			</div>
                                   			
                                   			
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-old_password">公众号类型</label>
                                   				<div class="controls">
                                   					<select name="wechatType">
                                   						<option value="1">服务号</option>
                                   						<option value="2">订阅号</option>
                                   					</select>
                                   				</div>
                                   			</div>
                                   			
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-old_password">文章url</label>
                                   				<div class="controls">
                                   					<input type="text"  name="wechatArticle" placeholder="http://" value="" >
                                   					公众号发布过的文章链接地址（任意文章）
                                   				</div>
                                   			</div>

                                   			<if condition="$Think.session.user.user_type eq 2">
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-old_password">粉丝数</label>
                                   				<div class="controls">
                                   					<input type="text" id="input-old_password" placeholder="粉丝数" name="pwc_fsnum">
                                   				</div>
                                   			</div>
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-old_password">单图文价格</label>
                                   				<div class="controls">
                                   					<input type="text" id="input-old_password" placeholder="单图文价格" name="price_d">
                                   				</div>
                                   			</div>
                                   		
                                   			
                                   			</if>
                                   		
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-password">头像</label>
                                   				<div class="controls">
                                   					<input type="text" id="input-touxiang" class="span2" placeholder="头像" name="pwc_tx" value="" readonly="readonly" />
                                   					<input type="file" onchange="avatar_upload(this,'#input-touxiang');" id="avatar_uploder"  name="file"/>
                                   				</div>
                                   			</div>
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-repassword">二维码</label>
                                   				<div class="controls">
                                   					<input type="text" id="ecode" class="span2"  name="pwc_ewm" value="" readonly="readonly" />
                                   					<input type="file" onchange="avatar_upload(this,'#ecode');" id="avatar_uploder2"  name="file"/>
                                   				</div>
                                   			</div>
                                   			
                                   			<if condition="$Think.session.user.user_type eq 2">
                                   			<div class="control-group">
                                   				<label class="control-label" for="input-repassword">粉丝截图</label>
                                   				<div class="controls">
                                   					<input type="text" id="fsjt" class="span2"  name="pwc_fs" value="" readonly="readonly" />
                                   					<input type="file" onchange="avatar_upload(this,'#fsjt');" id="avatar_uploder3"  name="file" />
                                   				</div>
                                   			</div>
                                   			</if>
                                   			<div class="control-group">
                                   				<div class="controls">
                                   					<button type="submit" class="btn J_ajax_submit_btn">保存</button>
                                   				</div>
                                   			</div>
                                   		</form>
                                   			
                                   		
                                   		
                                   </div>
                               </div>							
                           </div>
                    </div>
                </div>

		<tc_include file="Public:footer" />

	</div>
	<!-- /container -->

	<tc_include file="Public:scripts" />
	<script type="text/javascript">
	avatar_upload("");
	function avatar_upload(obj,dr){
		var $fileinput=$(obj);
		var dr=$(dr);
		var id=$fileinput.attr("id");
		Wind.css("jcrop");
		Wind.use("ajaxfileupload","jcrop","noty",function(){
			$.ajaxFileUpload({
				url:"{:U('profile/updateImg')}",
				secureuri:false,
				fileElementId:id,
				dataType: 'json',
				data:{},
				success: function (data, status){
				
					if(data.status==1){
						
						dr.val(data.data.file);
						
					}else{
						noty({text: data.info,
                    		type:'error',
                    		layout:'center'
                    	});
					}
					
				},
				error: function (data, status, e){}
			});
		});
		
		
		
		return false;
	}
	
	
	//$("button[type='submit']").
</script>
	
	
</body>
</html>